import axios from "axios";
const httpInstance = axios.create({
    baseURL: "/api",
    timeout: 5000,
    // withCredentials: true,
});
// 拦截器
// axios请求拦截器
httpInstance.interceptors.request.use(
    req => {
    if ('get'.includes(req.method?.toLowerCase())) req.params = req.data
    return req
}, e => Promise.reject(e))
// axios响应式拦截器
httpInstance.interceptors.response.use(res => res.data, e => {
    return Promise.reject(e)
})
export default httpInstance;